<template>
  <div class="home-container">
    <h2 class="content-title">首页</h2>
  
    <div class="home-content-layout">
     
      
    </div>
  </div>
</template>

<script setup>
import { ref } from 'vue'

// Emits
const emit = defineEmits(['navigate'])

// 首页数据
const systemNews = ref([
  { 
    title: '2024年秋季学期社团招新活动即将开始', 
    date: '2024-08-20', 
    content: '学校将于9月1日至9月15日举办2024年秋季学期社团招新活动，全校共有35个社团参与招新，欢迎新老同学积极报名参加。',
    source: '社团管理中心'
  },
  { 
    title: '社团管理系统功能更新公告', 
    date: '2024-08-15', 
    content: '本次更新新增了活动报名、消息通知等功能，优化了用户界面，提升了系统性能，欢迎用户体验。',
    source: '系统运维团队'
  },
  { 
    title: '校级优秀社团评选结果公布', 
    date: '2024-08-10', 
    content: '2023-2024学年校级优秀社团评选结果已公布，共有8个社团获得"校级优秀社团"称号，详情请查看通知公告。',
    source: '学生工作部'
  }
])

const featuredEvents = ref([
  { 
    id: 1,
    title: '编程爱好者交流会', 
    type: '技术类', 
    time: '2024-09-05 14:00', 
    location: '科技楼301', 
    description: '邀请校内编程达人分享学习经验和项目开发心得，适合各水平的编程爱好者参加。',
    organizer: '计算机社团',
    status: '报名中',
    statusClass: 'status-ongoing'
  },
  { 
    id: 2,
    title: '校园音乐节', 
    type: '文艺类', 
    time: '2024-09-12 18:30', 
    location: '大礼堂', 
    description: '校园乐队现场演出，展示学生音乐才华，为校园生活增添艺术氛围。',
    organizer: '音乐社团',
    status: '即将开始',
    statusClass: 'status-upcoming'
  },
  { 
    id: 3,
    title: '志愿者招募活动', 
    type: '公益类', 
    time: '2024-09-07 10:00', 
    location: '食堂广场', 
    description: '招募校园志愿者，参与社区服务和校园公益活动，为社会贡献力量。',
    organizer: '青年志愿者协会',
    status: '报名中',
    statusClass: 'status-ongoing'
  }
])

// 参加活动
const joinEvent = (eventId) => {
  console.log('参加活动:', eventId)
  // 这里可以添加实际的活动报名逻辑
  alert(`成功报名活动！`)
}
</script>

<style scoped>
.home-container {
  width: 100%;
}

/* 首页内容布局 */
.home-content-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 24px;
}

/* 首页区块 */
.home-section {
  background-color: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
}

/* 新闻区块 */
.news-section {
  min-height: 600px;
}

.news-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 16px;
}

.news-item {
  padding: 16px;
  border: 1px solid #f0f0f0;
  border-radius: 6px;
  transition: all 0.3s;
}

.news-item:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

.news-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.news-title {
  font-size: 16px;
  font-weight: 600;
  color: #333;
  margin: 0;
  flex: 1;
  margin-right: 12px;
}

.news-date {
  font-size: 12px;
  color: #999;
  white-space: nowrap;
}

.news-content {
  font-size: 14px;
  color: #666;
  line-height: 1.6;
  margin-bottom: 8px;
}

.news-source {
  font-size: 12px;
  color: #999;
  text-align: right;
}

/* 活动区块 */
.events-section {
  min-height: 600px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.featured-events {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.event-card {
  padding: 16px;
  border: 1px solid #f0f0f0;
  border-radius: 6px;
  transition: all 0.3s;
}

.event-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

.event-card-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.event-type {
  font-size: 12px;
  padding: 2px 8px;
  background-color: #f0f2f5;
  border-radius: 4px;
  color: #666;
}

.event-card-title {
  font-size: 16px;
  font-weight: 600;
  color: #333;
  margin: 8px 0;
}

.event-card-info {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: #666;
  margin-bottom: 8px;
}

.event-card-desc {
  font-size: 14px;
  color: #666;
  line-height: 1.5;
  margin-bottom: 12px;
}

.event-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.event-organizer {
  font-size: 13px;
  color: #999;
}

.join-event-btn {
  padding: 6px 16px;
  background-color: #1890ff;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.join-event-btn:hover {
  background-color: #40a9ff;
}

/* 快速入口 */
.quick-access {
  background-color: #fafafa;
  border-radius: 6px;
  padding: 16px;
}

.access-title {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  margin: 0 0 12px 0;
}

.access-items {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.access-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 8px;
  background-color: white;
  border: 1px solid #f0f0f0;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s;
}

.access-item:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

.access-icon {
  font-size: 24px;
}

.access-text {
  font-size: 13px;
  color: #666;
}

/* 响应式设计调整 */
@media (max-width: 1024px) {
  .home-content-layout {
    grid-template-columns: 1fr;
  }
  
  .news-section,
  .events-section {
    min-height: auto;
  }
}

@media (max-width: 768px) {
  .access-items {
    grid-template-columns: 1fr;
  }
}
</style>